package com.jichaoyun.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

/**
 * 
 * @TableName menu
 */
@TableName(value ="menu")
@Data
public class Menu implements Serializable {
    /**
     * 菜单列表id
     */
    @TableId(value = "menu_id", type = IdType.AUTO)
    private Integer menuId;

    /**
     * 组件
     */
    private String component;

    /**
     * 后端访问路径
     */
    private String path;

    /**
     * 重定向
     */
    private String redirect;

    /**
     * 组件英文名
     */
    private String name;

    /**
     * 文字标题
     */
    private String title;

    /**
     * 图标
     */
    private String icon;

    /**
     * 父节点id
     */
    private Integer parentId;

    /**
     * 0不是1是
     */
    private Boolean isLeaf;

    /**
     * 0不是1是
     */
    private Boolean hidden;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @TableField(exist = false)
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<Menu> children;

    @TableField(exist = false)
    private Map<String,Object> mata;
    public Map<String,Object> getMata(){
        mata = new HashMap<>();
        mata.put("title",title);
        mata.put("icon",icon);
        return  mata;
    }






}